/**
 * 
 */
package com.logistics.web;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.logistics.Express;
import com.logistics.ExpressQueryParam;
import com.logistics.admin.AdminGenericBaseAction;
import com.logistics.service.ExpressService;

/**
 * @author hzz
 *
 * 2014年4月2日
 */

@Component("expressAdminAction")
@Scope("prototype")
public class ExpressAdminAction extends AdminGenericBaseAction<Express, ExpressService> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	private ExpressService service;
	
	@Autowired
	public void setService(ExpressService service) {
		this.service = service;
	}

	@Override
	public ExpressService getService() {
		return service;
	}

	private Express express;
	
	public Express getExpress() {
		return express;
	}

	public void setExpress(Express express) {
		this.express = express;
	}
	
	private List<Express> expresses;

	public List<Express> getExpresses() {
		return expresses;
	}

	public void setExpresses(List<Express> expresses) {
		this.expresses = expresses;
	}
	
	private ExpressQueryParam param;

	public ExpressQueryParam getParam() {
		return param;
	}

	public void setParam(ExpressQueryParam param) {
		this.param = param;
	}

	@Override
	protected Express initEntityForAdd() {
		return express;
	}
	
	public String list() {
		if (param == null) {
			param = new ExpressQueryParam();
		}
		
		param.setPaging(getPaging());
		expresses = service.query(param);
		return LIST;
	}

}
